﻿using System.Xml;
using Hammock;
using Hammock.Serialization;
using Harvest.Api.Interfaces;

namespace Harvest.Api
{

    public class RestRequestProvider : IRestRequestProvider
    {

        private readonly RestRequest _restRequest;

        public string Login { get; set; }

        public string Password { get; set; }

        public string Account { get; set; }


        public RestRequest RestRequest
        {
            get
            {
                return _restRequest;
            }
        }

        public RestRequestProvider(string account, string login, string password)
        {
            var serializer = new HammockXmlSerializer(new XmlWriterSettings());
            _restRequest = new RestRequest
            {
                Serializer = serializer,
                Deserializer = serializer
            };
            Account = account;
            Login = login;
            Password = password;
        }

    }

}
